#!/usr/bin/env python

import wx

class Frame(wx.Frame):	
	def __init__(self, parent, id, title):
		wx.Frame.__init__(self, parent, id, title)

class App(wx.App):

	def __init__(self):
		wx.App.__init__(self)
		
	def OnInit(self):
		self.frame = Frame(parent=None, id=-1, title='Please wait a minute ...')
		self.panel = TestPanel ( self.frame );
		self.frame.Show()
		self.SetTopWindow(self.frame)

		return True

#----------------------------------------------------------------------

class TestPanel(wx.Panel):

    def __init__(self, parent):
        wx.Panel.__init__(self, parent)
        self.count = 0

        gaugeRange = 50
        gaugePos = wx.DefaultPosition
        gaugeSize = wx.DefaultSize

        self.g1 = wx.Gauge(self, -1, gaugeRange, gaugePos, gaugeSize)
        self.g2 = wx.Gauge(self, -1, 50, (110, 95), (250, 25), wx.GA_PROGRESSBAR)
        self.g3 = wx.Gauge(self, -1, 50, (110, 125), (250, 25))

        self.Bind(wx.EVT_TIMER, self.TimerHandler)
        self.timer = wx.Timer(self)
        self.timer.Start(100)

    def __del__(self):
        self.timer.Stop()

    def TimerHandler(self, event):
        self.count = self.count + 1

        if self.count >= 50:
            self.count = 0

        self.g1.SetValue(self.count)
        self.g2.Pulse()
        self.g3.Pulse()
    

#----------------------------------------------------------------------

def main():
	app = App()
	app.MainLoop()
	
if __name__ == '__main__':
	main()
	
